/**
 * Created by icyhy on 2017/5/23.
 */
"use strict";
module.exports = {
  /**
   * 返回成功呢
   */
  buildSuccessResultInfo:function(res) {
    var result = {
      resultCode: 0,
      resultMessage: "success"
    };
    return res.json(result);
  },

  buildSuccessResultInfoWithData:function(res, data){
    var result = {
      resultCode: 0,
      resultMessage: "success",
      resultData: data
    };
    return res.json(result);
  },
  buildFailedResultInfo:function(res,resultCode, resultMessage){
    var result = {
      resultCode:resultCode,
      resultMessage:resultMessage
    };
    return res.json(result);
  },
  buildFailedResultInfoWithMsg:function(res,resultCode, resultMessage){
    var result = {
      resultCode:resultCode,
      resultMessage:resultMessage
    };
    return res.json(result);
  },
  buildBadRequestResult: function (res) {
    return this.buildFailedResultInfo(res, 400,"Bad Request");
  },
  buildBadRequestResultWithMessage: function (res, msg) {
    return this.buildFailedResultInfo(res, 400, msg);
  },
}
